{% extends "base.html" %}

{% block content %}
    <h2>Components of branch {{branch.name}}:</h2>
    
    {% for category in category_list %}
    <hr>
    <h3>{{category.name}}</h3>
    <table class="details">
        <tr>
            <th>Name (LOC)</th>
            {% for tool_config in category.tool_config_list %}
                <th>{{ tool_config.tool.name }}</th>
            {% endfor %}
            <th>Rank</th>
            <th>Target</th>
        </tr>
        {% for component in category.component_list %}
            <tr class="tableRow">
                <td>{{ component.name }} ({{component.line_of_code}})</td>
                {% for data in component.data %}
                    <td>{{ data|safe }}</td>
                {% endfor %}
                <td><font color="{% if component.rank_ok %}#00CC00{%else%}#CC0000{%endif%}">{{component.total_rank}}</font></td>
                <td>{{component.target_rank}}</td>
            </tr>
        {% endfor %}
    </table>
    {% endfor %}
{% endblock %}
